#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
using namespace std;
int n;
string s;
int main()
{
    cin >> n >> s;
    int l = 0, ans = 0;
    while (l < n)
    {
        if (s[l] != 'x') l++;
        else
        {
            int r = l;
            while (s[r] == 'x') r++;
            int len = r - l;
            ans += max(0, len - 2);
            l = r;
        }
    }
    cout << ans << endl;
    return 0;
}